{extend name="adminblue/base" /}
{block name="resources"/}
{/block}
{block name="main"}

<table class="table-class">
	<thead>
		<tr align="center">
			<th><input type="checkbox" onclick="CheckAll(this)"></th>
			<th>open_id</th>
			<th>用户发言</th>
			<th>机器人回复</th>
			<th>时间</th>
		</tr>
	</thead>
	<tbody></tbody>
</table>
{/block}
{block name="script"}

<script type="text/javascript">
function LoadingInfo(page_index) {
	var search_text = $("#search_text").val();
	$.ajax({
		type : "post",
		url : __URL("ADMIN_MAIN/wchat/userChat"),
		data : { "page_index" : page_index, "page_size" :  $("#showNumber").val() },
		success : function(data) {
			var html = '';
			if (data["data"].length > 0) {
				for (var i = 0; i < data["data"].length; i++) {
					html += '<tr align="center">';
						html += '<td><input name="sub" type="checkbox" value="'+ data["data"][i]["level_id"]+'" ></td>';
						html += '<td>'+ data["data"][i]["open_id"]+'</td>';
						html += '<td>'+ data["data"][i]["msg"]+'</td>';
						html += '<td>'+ data['data'][i]['replay']+ '</td>';
						html += '<td>'+ timeStampTurnTime(data["data"][i]["create_time"]) + '</td>';
					html += '</tr>';
				}
			} else {
				html += '<tr align="center"><td colspan="5">暂无符合条件的数据记录</td></tr>';
			}
			$(".table-class tbody").html(html);
			initPageData(data["page_count"],data['data'].length,data['total_count']);
			$("#pageNumber").html(pagenumShow(jumpNumber,$("#page_count").val(),{$pageshow}));
		}
	});
}

//全选
function CheckAll(event){
	var checked = event.checked;
	$(".table-class tbody input[type = 'checkbox']").prop("checked",checked);
}

</script>
{/block}